﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.Prop;

namespace Web.masterpage
{
    public partial class Site : System.Web.UI.MasterPage
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            try
            {
                /**/
                if (Session["UserInfo"] == null)
                    Response.Redirect("~/singin.aspx", false);

                else
                    if(String.IsNullOrEmpty(((USER) Session["UserInfo"]).UID))
                        Response.Redirect("~/singin.aspx", false);
            }
            catch (Exception ex)
            {
                 Dao.TransactionlogDao.Init().Add(new Transactionlog()
                            {
                                UID = null
                                ,
                                EVENT = Core.Events.Login.ToString()
                                ,
                                LASTIP = Request.ServerVariables["REMOTE_ADDR"]
                                ,
                                UPDATE = DateTime.Now
                                ,
                                DESCRIPT = ex.Message
                            });
                        }

        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}